package cn.iocoder.yudao.module.member.controller.app.auth.vo;

import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponRespDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "用户 APP - 登录 Response VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class AppAuthLoginRespVO {

    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Long userId;

    @Schema(description = "访问令牌", requiredMode = Schema.RequiredMode.REQUIRED, example = "happy")
    private String accessToken;

    @Schema(description = "刷新令牌", requiredMode = Schema.RequiredMode.REQUIRED, example = "nice")
    private String refreshToken;

    @Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime expiresTime;

    @Schema(description = "是否需要完善信息")
    private Boolean needsInformation;

    /**
     * 仅社交登录、社交绑定时会返回
     *
     * 为什么需要返回？微信公众号、微信小程序支付需要传递 openid 给支付接口
     */
    @Schema(description = "社交用户 openid", example = "qq768")
    private String openid;

    @Schema(description = "社交用户是否已绑定账号，未绑定时需要引导注册或登录绑定", example = "false")
    private boolean bound;

    @Schema(description = "社交用户绑定key，后续引导注册或登录绑定使用", example = "qq768")
    private String socialUserKey;

    private List<CouponRespDTO> registerCoupons;

    private String agentQrCode;
}
